package models

import (
	"github.com/goravel/framework/database/orm"
)

type DownloadRecord struct {
	orm.Model
	UserID          uint   `gorm:"column:user_id;type:bigint(20);not null;default:0;comment:'用户ID'" form:"user_id" json:"user_id"`
	ConfigurationID uint   `gorm:"column:configuration_id;type:bigint(20);not null;default:0;comment:'配置ID'" form:"configuration_id" json:"configuration_id"`
	FileName        string `gorm:"column:file_name;type:varchar(255);not null;default:'';comment:'文件名'" form:"file_name" json:"file_name"`
	FilePath        string `gorm:"column:file_path;type:varchar(255);not null;default:'';comment:'文件路径'" form:"file_path" json:"file_path"`
	FileSize        uint64 `gorm:"column:file_size;type:bigint(20);not null;default:0;comment:'文件大小'" form:"file_size" json:"file_size"`
	CurrentOrder    int    `gorm:"column:current_order;type:bigint(20);not null;default:0;comment:'当前下载顺序'" form:"current_order" json:"current_order"`
	//是否需要下载
	IsNeedDownloadAndParse int `gorm:"column:is_need_download_and_parse;type:tinyint(1);not null;default:0;comment:'是否需要下载解析'" form:"is_need_download_and_parse" json:"is_need_download_and_parse"`
}

// TableName Get table name.
func (m *DownloadRecord) TableName() string {
	return "downloadrecords"
}
